import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Arma here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Arma extends Obstaculos
{
    /**
     * Act - do whatever the Arma wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     * */
    private Actor collided;
    public void act() 
    {
        super.act();
        /*if(Greenfoot.isKeyDown("a"))
        {
           // mueveIzq();
            //check();
        }*/
    } 
     public void check()
    {
        collided = getOneIntersectingObject(Peaton.class);
        if (collided != null || getX()==0)
        {
           getWorld().removeObject(this);
        }
    }
    
     public void mueveIzq()
    {
       World mundo=getWorld();
       if(((Mundo) getWorld()).getPause() == true)
       {
          setLocation(getX()-((Mundo)mundo).dameSpeedScroll(), getY());
       }
    }
    public void checaLimite()
    {
       if (getX()==0)
       {
          getWorld().removeObject(this);
       }
    } 
    
    public void explota()
    {
  
        getWorld().removeObject(this);
    }
}

